package com.om.base;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.om.common.BaseAuthorizationUser;



public abstract class AuthorizationCache {

	public static Class AuthorizationCacheClass = null;

	public static  AuthorizationCache getInstance() {
		AuthorizationCache instance = null;
		try {
			if (AuthorizationCacheClass != null) {
				instance = (AuthorizationCache) Class.forName(
						AuthorizationCacheClass.getName()).newInstance();
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return instance;
	}

	public abstract void cacheLoginUser(BaseAuthorizationUser user
			,HttpServletRequest request
			, HttpServletResponse response );

	
	public abstract void destroyLoginUser(HttpServletRequest request,HttpServletResponse response);
	
	public abstract BaseAuthorizationUser getLoginUser(Class AuthorizationUser,HttpServletRequest request,HttpServletResponse response);

	public abstract BaseAuthorizationUser getLoginUser(HttpServletRequest request, HttpServletResponse response);
	
	public abstract BaseAuthorizationUser reLoadLoginUser(Class AuthorizationUserClass,HttpServletRequest request ,HttpServletResponse response);
	
	public abstract String getLoginName(HttpServletRequest request);

	public abstract String getLoginPassword(HttpServletRequest request);

	public abstract Object getLoginUserID(HttpServletRequest request);

	public abstract String getLoginUserPowers(HttpServletRequest request);
	
	public abstract String getLoginUserRoles(HttpServletRequest request,HttpServletResponse response );
	
	public abstract ArrayList<String> getPowerList(HttpServletRequest request,HttpServletResponse response);
	
	
	

}
